const apiHostUrl  = process.env.API_HOST_URL ? process.env.API_HOST_URL : "https://mock.apipost.net/mock/3d0aad4ad808000"
/**
 * 查询奖品列表
 * @param strategyId
 */
export const queryRaffleAwardList = (strategyId: number | null) =>{
    try {
        return fetch(`${apiHostUrl }//api/v1/raffle/query_raffle_award_list?strategyId=${strategyId}&apipost_id=10ab0d5ab12003`,{
            method:'get',
            headers:{
                'Content-Type': 'application/json;charset=utf-8'
            }
        })
    }catch (error){
        return fetch("{\n" +
            "    \"code\": \"0001\",\n" +
            "    \"info\": \"调用失败\",\n" +
            "    \"data\": [\n" +
            "}");

    }
}

/**
 * 随机抽奖
 * @param strategyId
 */
export const randomRaffle = (strategyId: number | null) => {
    try {
        return fetch(`${apiHostUrl }/api/v1/raffle/random_raffle?strategyId=${strategyId}&apipost_id=10ab3c90712007`, {
            method: 'get',
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            }
        })
    } catch (error) {
        return fetch("{\n" +
            "    \"code\": \"0001\",\n" +
            "    \"info\": \"调用失败\",\n" +
            "    \"data\": [\n" +
            "}");
    }
}
